package com.tools.common.container;

import com.tools.common.object.Note;

import java.util.Collection;
import java.util.Comparator;
import java.util.Map;

/**
 * 自定义 Map 集合容器的
 * 默认实现，继承自 AbsOwnPair 类
 * 拥有 OwnPairs 的默认实现功能
 * 以及 AbsOwnPair 类的扩展功能
 * 基本兼容原生 Map 的方法
 * */
@Note("自定义 Map 集合容器的默认实现，继承自 AbsOwnPair 类" +
        "拥有 OwnPairs 的默认实现功能，以及 AbsOwnPair 类的" +
        "扩展功能，基本兼容原生 Map 的方法")
public class OwnMap<K, V> extends AbsOwnPair<K, V> {

    public OwnMap() {
        super(true);
    }

    public OwnMap(int initSize) {
        super(true, initSize);
    }

    public OwnMap(Map<? extends K, ? extends V> map) {
        super(true, map);
    }

    public OwnMap(OwnPairs<? extends K, ? extends V> pair) {
        super(true, pair);
    }

    public OwnMap(MapEnum implEnum) {
        super(true, implEnum);
    }

    public OwnMap(MapEnum implEnum, int initSize) {
        super(true, implEnum, initSize);
    }

    public OwnMap(MapEnum implEnum, int initSize, Comparator<? super K> c) {
        super(true, implEnum, initSize, c);
    }

    public OwnMap(MapEnum implEnum, Comparator<? super K> c) {
        super(true, implEnum, c);
    }

    public OwnMap(MapEnum implEnum, Map<? extends K, ? extends V> map) {
        super(true, implEnum, map);
    }

    public OwnMap(MapEnum implEnum, Map<? extends K, ? extends V> map, Comparator<? super K> c) {
        super(true, implEnum, map, c);
    }

    public OwnMap(MapEnum implEnum, OwnPairs<? extends K, ? extends V> pair) {
        super(true, implEnum, pair);
    }

    public OwnMap(MapEnum implEnum, OwnPairs<? extends K, ? extends V> pair, Comparator<? super K> c) {
        super(true, implEnum, pair, c);
    }

    /* *******************************************************************************************
     *
     *          重写方法
     *
     * *******************************************************************************************
     * */

    @Override
    public OwnMap<K, V> put(K key, V value) {
        super.protected_putOne(key, value);
        return this;
    }

    @Override
    public OwnMap<K, V> putIfAbsent(K sourceKey, V backupValue) {
        super.protected_putIfAbsent(sourceKey, backupValue);
        return this;
    }

    @Override
    public OwnMap<K, V> putAll(Map<? extends K, ? extends V> map) {
        super.protected_putAll(map);
        return this;
    }

    @Override
    public OwnMap<K, V> putAll(OwnPairs<? extends K, ? extends V> pair) {
        super.protected_putAll(pair);
        return this;
    }

    @Override
    public OwnMap<K, V> remove(Object key) {
        super.protected_removeOne(key);
        return this;
    }

    @Override
    public final OwnMap<K, V> removeAll(Object... keys) {
        super.protected_removeAll(keys);
        return this;
    }

    @Override
    public OwnPairs<K, V> removeAll(Collection<?> keys) {
        super.protected_removeAll(keys);
        return this;
    }

    @Override
    public OwnPairs<K, V> removeAll(OwnRows<?> keys) {
        super.protected_removeAll(keys);
        return this;
    }

    @Override
    public OwnMap<K, V> removeAll(Iterable<?> keys) {
        super.protected_removeAll(keys);
        return this;
    }

    @Override
    public OwnMap<K, V> remove(K key, V value) {
        super.protected_removeOne(key, value);
        return this;
    }

    @Override
    public OwnMap<K, V> removeAll(Map<? extends K, ? extends V> map) {
        super.protected_removeAll(map);
        return this;
    }

    @Override
    public OwnMap<K, V> removeAll(OwnPairs<? extends K, ? extends V> pair) {
        super.protected_removeAll(pair);
        return this;
    }

    @Override
    public OwnMap<K, V> replace(K key, V newValue) {
        super.protected_replace(key, newValue);
        return this;
    }

    @Override
    public OwnMap<K, V> replace(K key, V oldValue, V newValue) {
        super.protected_replace(key, oldValue, newValue);
        return this;
    }

    @Override
    @SafeVarargs
    public final boolean containsAllKey(K... keys) {
        return super.containsAllKey(keys);
    }

    @Override
    @SafeVarargs
    public final boolean containsAnyKey(K... keys) {
        return super.containsAnyKey(keys);
    }

    @Override
    @SafeVarargs
    public final boolean containsAllValue(V... values) {
        return super.containsAllValue(values);
    }

    @Override
    @SafeVarargs
    public final boolean containsAnyValue(V... values) {
        return super.containsAllValue(values);
    }
}
